package del2.a;
import java.util.ArrayList;

public class Instructor extends Person {
	private ArrayList<String> courses;

	public Instructor(String name, String course){
		super(name);
		courses = new ArrayList<String>();
		addCourse(course);
	}
	
	public void addCourse(String course){
		courses.add(course);
	}
	
	public ArrayList<String> getCourses(){
		return courses;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append(super.getName() + "\n         Instructor {");
		for(String course : courses){
			sb.append(course + ", ");
		}
		sb.delete(sb.length() - 2, sb.length());
		sb.append("}");
		return sb.toString();
	}
}